-
-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to include ffprobe #61
Conversation
marcello3d
commented
Sep 10, 2020
- rename from ffmpeg-static to ffmpeg-ffprobe-static
- update index.js to export both ffmpegPath and ffprobePath
- add index.d.ts for TypeScript
- do not download if the file is already downloaded
- unzip both ffmpeg and ffprobe to bin/ffmpeg-* and bin/ffprobe-*
- add darwin ffprobe download (separate zip)
- update github workflow to upload ffmpeg/ffprobe files with new names
- add github workflow for running test (instead of travis)
- fix tar commands on macos (hope it doesn't break linux)
- add ffprobe tests
- rename from ffmpeg-static to ffmpeg-ffprobe-static - update index.js to export both ffmpegPath and ffprobePath - add index.d.ts for TypeScript - do not download if the file is already downloaded - unzip both ffmpeg and ffprobe to bin/ffmpeg-* and bin/ffprobe-* - add darwin ffprobe download (separate zip) - update github workflow to upload ffmpeg/ffprobe files with new names - add github workflow for running test (instead of travis) - fix tar commands on macos (hope it doesn't break linux) - add ffprobe tests
if [ $? -ne 0 ]; then | ||
tar_exec=$(command -v tar) | ||
fi | ||
set -e | ||
echo using tar executable at $tar_exec | ||
|
||
download () { | ||
curl -L -# --compressed -A 'https://github.com/eugeneware/ffmpeg-static' -o $2 $1 | ||
if [ -e $2 ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd only accept a logic that does not download again, if it compares Last-Modified
or ETag
to make sure there isn't a new/different binary available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, I'll probably take this code out since I was just using it to test locally without downloading each time :)
.then(() => { | ||
fs.chmodSync(ffmpegPath, 0o755) // make executable | ||
}) | ||
.catch(exitOnError) | ||
downloadFile(ffprobeUrl, ffprobePath, onProgress) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run these sequentially.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch! do you prefer sequentially or in parallel?
@@ -1,8 +1,9 @@ | |||
{ | |||
"name": "ffmpeg-static", | |||
"name": "ffmpeg-ffprobe-static", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to keep ffmpeg-static
as a name, because a) it is already a known name, and b) the name "ffmpeg" is arguably a lot more well-known than "ffprobe".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of this PR looks good! I commented on a few issues.
@derhuerst hello! sorry I prematurely made the PR against this repo (github default). I'm still testing things out in the fork right now (some of these changes were just so that I could test locally on my mac) Is this something you'd like to merge in? It roughly doubles the size of the package, and is a breaking API change (since I need to export two paths). |
Yeah, that's the only major headache I have with this change. On macOS, this doubles the installation size and traffic from ~70mb to ~140mb. |
So there's another project we've been using ffprobe-static, but it hasn't been updated in a while and bundles all the platform binaries (instead of downloading). I also published ffmpeg-ffprobe-static as a separate package which has both as in this PR. I could imagine a lerna workspaces thing where a single github release has all the binaries, but separate npm packages are published that each only download the one binary. Not sure if there's a more lightweight to do two packages in one repo. |
There is a more lightweight way! Lerna is basically an agreed-upon and (for 2 packages IMO) over-engineered way to do it. |
Thanks a lot for your work on adding ffprobe @marcello3d |
Yes, see #19 (comment) . |
@mifi we're maintaining it for the near future, although we're migrating to using shared libraries (packaged in the same folder) so that the total size is much smaller. So I'm not sure if the name will still be applicable. :-) |
Ok @marcello3d |